
<?php
     include_once('Configs/database.php');
     
     class BoMon extends database{
         private $mabm;
         private $tenbm;
         private $makhoa;
         public function setMaBM($mabm){
            $this->mabm = $mabm;
         }
         public function setTenBM($tenbm){
            $this->tenbm = $tenbm;
         }
         public function setMaKhoa($makhoa){
            $this->makhoa = $makhoa;
         }
         public function getMaBM(){
            return $this->mabm;
         }
         public function getMaKhoa(){
            return $this->makhoa;
         }
         public function getTenBM(){
            
             return $this->tenbm;
         }
         //public function themBM($mabm,$tenbm,$makhoa){
            
         //}
         public function thongTinBM(){
            $this->setQuery("select * from BoMon where mabm='".$this->getMaBM()."'");
            return $this->fetchAll();
         }
         public function themBM(){
                
            
             $this->setQuery("insert into BoMon(mabm,tenbm,makhoa) values ('".$this->getMaBM()."','".$this->getTenBM()."','".$this->getMaKhoa()."')");
             //return $this->getQuery();
             return $this->executeQuery();
         }
         public function suaBM(){
            $this->setQuery("update BoMon set tenbm='".$this->getTenBM()."',makhoa='".$this->getMaKhoa()."' where mabm='".$this->getMaBM()."'");
            
            return $this->executeQuery();
         }
         public function xoaBM(){
            $this->setQuery("delete from BoMon where mabm='".$this->getMaBM()."'");
            return $this->executeQuery();
         }
         public function dsBMTheoKhoa($makhoa){
            $this->setQuery("select * from BoMon where makhoa='".$makhoa."'");
            return $this->fetchAll();
         }
         public function dsTatCaBM(){
            $this->setQuery("select * from BoMon order by tenbm");
            return $this->fetchAll();
         }
     }
?>
